<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateRecognizeFoodProduceLicenseResultsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recognize_food_produce_license_results', function (Blueprint $table) {
            $table->id();
            $table->string('url', 128)->unique('url')->comment('公开OSS库文件路径，全局唯一');
            $table->string('producerName', 50)->default('')->comment('经营者名称');
            $table->string('creditCode', 50)->default('')->comment('社会信用代码');
            $table->string('legalRepresentative', 50)->default('')->comment('法定代表人');
            $table->string('officeAddress', 255)->default('')->comment('地址');
            $table->string('productionAddress', 255)->default('')->comment('经营场所');
            $table->string('foodType', 255)->default('')->comment('经营项目');
            $table->string('licenceNumber', 50)->default('')->comment('许可证编号');
            $table->string('regulatoryAuthority', 255)->default('')->comment('日常监督管理机构');
            $table->string('regulatoryPersonnel', 50)->default('')->comment('目常监督管理人员');
            $table->string('reportHotline', 50)->default('')->comment('投诉举报电话');
            $table->string('issueAuthority', 50)->default('')->comment('发证机关');
            $table->string('issueOfficer', 50)->default('')->comment('签发人');
            $table->date('issueDate')->nullable()->comment('有效期从');
            $table->date('validToDate')->nullable()->comment('有效期至');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '图像识别 - 食品经营许可证识别结果表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recognize_food_produce_license_results');
    }
}
